angular.module('app.routes', [])

.config(function($stateProvider, $urlRouterProvider,$ionicConfigProvider) {


  $ionicConfigProvider.tabs.style('standard').position('bottom');
  $ionicConfigProvider.backButton.text('返回').previousTitleText(false);
  $urlRouterProvider.otherwise('/tab/home');
  $stateProvider






    .state('tab', {
      url: '/tab',
      abstract:true,
      templateUrl: 'templates/tab.html'
    })



    .state('tab.home', {
      url: '/home',
      views: {
        'home-tab': {
          templateUrl: 'templates/home.html',
          controller: 'homeCtrl'
        }
      }
    })
    .state('tab.goods-detail', {
      url: '/home/goods-detail',
      views: {
        'home-tab': {
          templateUrl: 'templates/goods-detail.html',
          controller: 'goodsDetailCtrl'
        }
      }
    })

    .state('tab.phb', {
      url: '/phb',
      views: {
        'phb-tab': {
          templateUrl: 'templates/phb.html'
          // controller: 'contactsCtrl'
        }
      }
    })
    .state('tab.lottery-detail', {
      url: '/phb/lottery-detail',
      views: {
        'phb-tab': {
          templateUrl: 'templates/lottery-detail.html'
        }
      }
    })
    .state('tab.lucky-list', {
      url: '/phb/lottery-detail/lucky-list',
      views: {
        'phb-tab': {
          templateUrl: 'templates/lucky-list.html'
        }
      }
    })
    .state('tab.count-detail', {
      url: '/phb/lottery-detail/count-detail',
      views: {
        'phb-tab': {
          templateUrl: 'templates/count-detail.html'
        }
      }
    })





    .state('tab.person', {
      url: '/person',
      views: {
        'person-tab': {
          templateUrl: 'templates/person.html',
          controller: 'personCtrl'
        }
      }
    })






    .state('tab.pay', {
      url: '/person/pay',
      views: {
        'person-tab': {
          templateUrl: 'templates/pay.html'
        }
      }
    })


    .state('tab.order', {
      url: '/person/order',
      views: {
        'person-tab': {
          templateUrl: 'templates/order.html'
        }
      }
    })
    .state('tab.cart', {
      url: '/person/cart',
      views: {
        'person-tab': {
          templateUrl: 'templates/cart.html'
        }
      }
    })
    .state('tab.address', {
      url: '/person/address',
      views: {
        'person-tab': {
          templateUrl: 'templates/address.html'
        }
      }
    })
    .state('tab.new-address', {
      url: '/person/address/new-address',
      views: {
        'person-tab': {
          templateUrl: 'templates/new-address.html'
        }
      }
    })
    .state('tab.message', {
      url: '/person/message',
      views: {
        'person-tab': {
          templateUrl: 'templates/message.html'
        }
      }
    })

    .state('tab.rebate', {
      url: '/person/rebate',
      views: {
        'person-tab': {
          templateUrl: 'templates/rebate.html'
        }
      }
    })
    .state('tab.cash-list', {
      url: '/person/cash-list',
      views: {
        'person-tab': {
          templateUrl: 'templates/cash-list.html'
        }
      }
    })





});
